home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1998 November / Freeware November 1998.img / dist / fw_emacs.idb / usr / freeware / info / emacs-2.z / emacs-2 (.txt)
GNU Info File  |  1998-10-27  |  47KB  |  754 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.63 from the
  2. input file emacs.texi.
  3. File: emacs,  Node: Copying,  Next: Intro,  Prev: Distrib,  Up: Top
  4. GNU GENERAL PUBLIC LICENSE
  5. **************************
  6.                          Version 2, June 1991
  7.      Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  8.      675 Mass Ave, Cambridge, MA 02139, USA
  9.      
  10.      Everyone is permitted to copy and distribute verbatim copies
  11.      of this license document, but changing it is not allowed.
  12. Preamble
  13. ========
  14.    The licenses for most software are designed to take away your
  15. freedom to share and change it.  By contrast, the GNU General Public
  16. License is intended to guarantee your freedom to share and change free
  17. software--to make sure the software is free for all its users.  This
  18. General Public License applies to most of the Free Software
  19. Foundation's software and to any other program whose authors commit to
  20. using it.  (Some other Free Software Foundation software is covered by
  21. the GNU Library General Public License instead.)  You can apply it to
  22. your programs, too.
  23.    When we speak of free software, we are referring to freedom, not
  24. price.  Our General Public Licenses are designed to make sure that you
  25. have the freedom to distribute copies of free software (and charge for
  26. this service if you wish), that you receive source code or can get it
  27. if you want it, that you can change the software or use pieces of it in
  28. new free programs; and that you know you can do these things.
  29.    To protect your rights, we need to make restrictions that forbid
  30. anyone to deny you these rights or to ask you to surrender the rights.
  31. These restrictions translate to certain responsibilities for you if you
  32. distribute copies of the software, or if you modify it.
  33.    For example, if you distribute copies of such a program, whether
  34. gratis or for a fee, you must give the recipients all the rights that
  35. you have.  You must make sure that they, too, receive or can get the
  36. source code.  And you must show them these terms so they know their
  37. rights.
  38.    We protect your rights with two steps: (1) copyright the software,
  39. and (2) offer you this license which gives you legal permission to copy,
  40. distribute and/or modify the software.
  41.    Also, for each author's protection and ours, we want to make certain
  42. that everyone understands that there is no warranty for this free
  43. software.  If the software is modified by someone else and passed on, we
  44. want its recipients to know that what they have is not the original, so
  45. that any problems introduced by others will not reflect on the original
  46. authors' reputations.
  47.    Finally, any free program is threatened constantly by software
  48. patents.  We wish to avoid the danger that redistributors of a free
  49. program will individually obtain patent licenses, in effect making the
  50. program proprietary.  To prevent this, we have made it clear that any
  51. patent must be licensed for everyone's free use or not licensed at all.
  52.    The precise terms and conditions for copying, distribution and
  53. modification follow.
  54.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  55.   0. This License applies to any program or other work which contains a
  56.      notice placed by the copyright holder saying it may be distributed
  57.      under the terms of this General Public License.  The "Program",
  58.      below, refers to any such program or work, and a "work based on
  59.      the Program" means either the Program or any derivative work under
  60.      copyright law: that is to say, a work containing the Program or a
  61.      portion of it, either verbatim or with modifications and/or
  62.      translated into another language.  (Hereinafter, translation is
  63.      included without limitation in the term "modification".)  Each
  64.      licensee is addressed as "you".
  65.      Activities other than copying, distribution and modification are
  66.      not covered by this License; they are outside its scope.  The act
  67.      of running the Program is not restricted, and the output from the
  68.      Program is covered only if its contents constitute a work based on
  69.      the Program (independent of having been made by running the
  70.      Program).  Whether that is true depends on what the Program does.
  71.   1. You may copy and distribute verbatim copies of the Program's
  72.      source code as you receive it, in any medium, provided that you
  73.      conspicuously and appropriately publish on each copy an appropriate
  74.      copyright notice and disclaimer of warranty; keep intact all the
  75.      notices that refer to this License and to the absence of any
  76.      warranty; and give any other recipients of the Program a copy of
  77.      this License along with the Program.
  78.      You may charge a fee for the physical act of transferring a copy,
  79.      and you may at your option offer warranty protection in exchange
  80.      for a fee.
  81.   2. You may modify your copy or copies of the Program or any portion
  82.      of it, thus forming a work based on the Program, and copy and
  83.      distribute such modifications or work under the terms of Section 1
  84.      above, provided that you also meet all of these conditions:
  85.        a. You must cause the modified files to carry prominent notices
  86.           stating that you changed the files and the date of any change.
  87.        b. You must cause any work that you distribute or publish, that
  88.           in whole or in part contains or is derived from the Program
  89.           or any part thereof, to be licensed as a whole at no charge
  90.           to all third parties under the terms of this License.
  91.        c. If the modified program normally reads commands interactively
  92.           when run, you must cause it, when started running for such
  93.           interactive use in the most ordinary way, to print or display
  94.           an announcement including an appropriate copyright notice and
  95.           a notice that there is no warranty (or else, saying that you
  96.           provide a warranty) and that users may redistribute the
  97.           program under these conditions, and telling the user how to
  98.           view a copy of this License.  (Exception: if the Program
  99.           itself is interactive but does not normally print such an
  100.           announcement, your work based on the Program is not required
  101.           to print an announcement.)
  102.      These requirements apply to the modified work as a whole.  If
  103.      identifiable sections of that work are not derived from the
  104.      Program, and can be reasonably considered independent and separate
  105.      works in themselves, then this License, and its terms, do not
  106.      apply to those sections when you distribute them as separate
  107.      works.  But when you distribute the same sections as part of a
  108.      whole which is a work based on the Program, the distribution of
  109.      the whole must be on the terms of this License, whose permissions
  110.      for other licensees extend to the entire whole, and thus to each
  111.      and every part regardless of who wrote it.
  112.      Thus, it is not the intent of this section to claim rights or
  113.      contest your rights to work written entirely by you; rather, the
  114.      intent is to exercise the right to control the distribution of
  115.      derivative or collective works based on the Program.
  116.      In addition, mere aggregation of another work not based on the
  117.      Program with the Program (or with a work based on the Program) on
  118.      a volume of a storage or distribution medium does not bring the
  119.      other work under the scope of this License.
  120.   3. You may copy and distribute the Program (or a work based on it,
  121.      under Section 2) in object code or executable form under the terms
  122.      of Sections 1 and 2 above provided that you also do one of the
  123.      following:
  124.        a. Accompany it with the complete corresponding machine-readable
  125.           source code, which must be distributed under the terms of
  126.           Sections 1 and 2 above on a medium customarily used for
  127.           software interchange; or,
  128.        b. Accompany it with a written offer, valid for at least three
  129.           years, to give any third party, for a charge no more than your
  130.           cost of physically performing source distribution, a complete
  131.           machine-readable copy of the corresponding source code, to be
  132.           distributed under the terms of Sections 1 and 2 above on a
  133.           medium customarily used for software interchange; or,
  134.        c. Accompany it with the information you received as to the offer
  135.           to distribute corresponding source code.  (This alternative is
  136.           allowed only for noncommercial distribution and only if you
  137.           received the program in object code or executable form with
  138.           such an offer, in accord with Subsection b above.)
  139.      The source code for a work means the preferred form of the work for
  140.      making modifications to it.  For an executable work, complete
  141.      source code means all the source code for all modules it contains,
  142.      plus any associated interface definition files, plus the scripts
  143.      used to control compilation and installation of the executable.
  144.      However, as a special exception, the source code distributed need
  145.      not include anything that is normally distributed (in either
  146.      source or binary form) with the major components (compiler,
  147.      kernel, and so on) of the operating system on which the executable
  148.      runs, unless that component itself accompanies the executable.
  149.      If distribution of executable or object code is made by offering
  150.      access to copy from a designated place, then offering equivalent
  151.      access to copy the source code from the same place counts as
  152.      distribution of the source code, even though third parties are not
  153.      compelled to copy the source along with the object code.
  154.   4. You may not copy, modify, sublicense, or distribute the Program
  155.      except as expressly provided under this License.  Any attempt
  156.      otherwise to copy, modify, sublicense or distribute the Program is
  157.      void, and will automatically terminate your rights under this
  158.      License.  However, parties who have received copies, or rights,
  159.      from you under this License will not have their licenses
  160.      terminated so long as such parties remain in full compliance.
  161.   5. You are not required to accept this License, since you have not
  162.      signed it.  However, nothing else grants you permission to modify
  163.      or distribute the Program or its derivative works.  These actions
  164.      are prohibited by law if you do not accept this License.
  165.      Therefore, by modifying or distributing the Program (or any work
  166.      based on the Program), you indicate your acceptance of this
  167.      License to do so, and all its terms and conditions for copying,
  168.      distributing or modifying the Program or works based on it.
  169.   6. Each time you redistribute the Program (or any work based on the
  170.      Program), the recipient automatically receives a license from the
  171.      original licensor to copy, distribute or modify the Program
  172.      subject to these terms and conditions.  You may not impose any
  173.      further restrictions on the recipients' exercise of the rights
  174.      granted herein.  You are not responsible for enforcing compliance
  175.      by third parties to this License.
  176.   7. If, as a consequence of a court judgment or allegation of patent
  177.      infringement or for any other reason (not limited to patent
  178.      issues), conditions are imposed on you (whether by court order,
  179.      agreement or otherwise) that contradict the conditions of this
  180.      License, they do not excuse you from the conditions of this
  181.      License.  If you cannot distribute so as to satisfy simultaneously
  182.      your obligations under this License and any other pertinent
  183.      obligations, then as a consequence you may not distribute the
  184.      Program at all.  For example, if a patent license would not permit
  185.      royalty-free redistribution of the Program by all those who
  186.      receive copies directly or indirectly through you, then the only
  187.      way you could satisfy both it and this License would be to refrain
  188.      entirely from distribution of the Program.
  189.      If any portion of this section is held invalid or unenforceable
  190.      under any particular circumstance, the balance of the section is
  191.      intended to apply and the section as a whole is intended to apply
  192.      in other circumstances.
  193.      It is not the purpose of this section to induce you to infringe any
  194.      patents or other property right claims or to contest validity of
  195.      any such claims; this section has the sole purpose of protecting
  196.      the integrity of the free software distribution system, which is
  197.      implemented by public license practices.  Many people have made
  198.      generous contributions to the wide range of software distributed
  199.      through that system in reliance on consistent application of that
  200.      system; it is up to the author/donor to decide if he or she is
  201.      willing to distribute software through any other system and a
  202.      licensee cannot impose that choice.
  203.      This section is intended to make thoroughly clear what is believed
  204.      to be a consequence of the rest of this License.
  205.   8. If the distribution and/or use of the Program is restricted in
  206.      certain countries either by patents or by copyrighted interfaces,
  207.      the original copyright holder who places the Program under this
  208.      License may add an explicit geographical distribution limitation
  209.      excluding those countries, so that distribution is permitted only
  210.      in or among countries not thus excluded.  In such case, this
  211.      License incorporates the limitation as if written in the body of
  212.      this License.
  213.   9. The Free Software Foundation may publish revised and/or new
  214.      versions of the General Public License from time to time.  Such
  215.      new versions will be similar in spirit to the present version, but
  216.      may differ in detail to address new problems or concerns.
  217.      Each version is given a distinguishing version number.  If the
  218.      Program specifies a version number of this License which applies
  219.      to it and "any later version", you have the option of following
  220.      the terms and conditions either of that version or of any later
  221.      version published by the Free Software Foundation.  If the Program
  222.      does not specify a version number of this License, you may choose
  223.      any version ever published by the Free Software Foundation.
  224.  10. If you wish to incorporate parts of the Program into other free
  225.      programs whose distribution conditions are different, write to the
  226.      author to ask for permission.  For software which is copyrighted
  227.      by the Free Software Foundation, write to the Free Software
  228.      Foundation; we sometimes make exceptions for this.  Our decision
  229.      will be guided by the two goals of preserving the free status of
  230.      all derivatives of our free software and of promoting the sharing
  231.      and reuse of software generally.
  232.                                 NO WARRANTY
  233.  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  234.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  235.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  236.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  237.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  238.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  239.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  240.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  241.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  242.      SERVICING, REPAIR OR CORRECTION.
  243.  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  244.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  245.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  246.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  247.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  248.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
  249.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  250.      OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  251.      OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  252.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  253.                       END OF TERMS AND CONDITIONS
  254. How to Apply These Terms to Your New Programs
  255. =============================================
  256.    If you develop a new program, and you want it to be of the greatest
  257. possible use to the public, the best way to achieve this is to make it
  258. free software which everyone can redistribute and change under these
  259. terms.
  260.    To do so, attach the following notices to the program.  It is safest
  261. to attach them to the start of each source file to most effectively
  262. convey the exclusion of warranty; and each file should have at least
  263. the "copyright" line and a pointer to where the full notice is found.
  264.      ONE LINE TO GIVE THE PROGRAM'S NAME AND AN IDEA OF WHAT IT DOES.
  265.      Copyright (C) 19YY  NAME OF AUTHOR
  266.      
  267.      This program is free software; you can redistribute it and/or
  268.      modify it under the terms of the GNU General Public License
  269.      as published by the Free Software Foundation; either version 2
  270.      of the License, or (at your option) any later version.
  271.      
  272.      This program is distributed in the hope that it will be useful,
  273.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  274.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  275.      GNU General Public License for more details.
  276.      
  277.      You should have received a copy of the GNU General Public License
  278.      along with this program; if not, write to the Free Software
  279.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  280.    Also add information on how to contact you by electronic and paper
  281. mail.
  282.    If the program is interactive, make it output a short notice like
  283. this when it starts in an interactive mode:
  284.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  285.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  286.      type `show w'.  This is free software, and you are welcome
  287.      to redistribute it under certain conditions; type `show c'
  288.      for details.
  289.    The hypothetical commands `show w' and `show c' should show the
  290. appropriate parts of the General Public License.  Of course, the
  291. commands you use may be called something other than `show w' and `show
  292. c'; they could even be mouse-clicks or menu items--whatever suits your
  293. program.
  294.    You should also get your employer (if you work as a programmer) or
  295. your school, if any, to sign a "copyright disclaimer" for the program,
  296. if necessary.  Here is a sample; alter the names:
  297.      Yoyodyne, Inc., hereby disclaims all copyright
  298.      interest in the program `Gnomovision'
  299.      (which makes passes at compilers) written
  300.      by James Hacker.
  301.      
  302.      SIGNATURE OF TY COON, 1 April 1989
  303.      Ty Coon, President of Vice
  304.    This General Public License does not permit incorporating your
  305. program into proprietary programs.  If your program is a subroutine
  306. library, you may consider it more useful to permit linking proprietary
  307. applications with the library.  If this is what you want to do, use the
  308. GNU Library General Public License instead of this License.
  309. File: emacs,  Node: Intro,  Next: Glossary,  Prev: Copying,  Up: Top
  310. Introduction
  311. ************
  312.    You are reading about GNU Emacs, the GNU incarnation of the advanced,
  313. self-documenting, customizable, extensible real-time display editor
  314. Emacs.  (The `G' in `GNU' is not silent.)
  315.    We say that Emacs is a "display" editor because normally the text
  316. being edited is visible on the screen and is updated automatically as
  317. you type your commands.  *Note Display: Screen.
  318.    We call it a "real-time" editor because the display is updated very
  319. frequently, usually after each character or pair of characters you
  320. type.  This minimizes the amount of information you must keep in your
  321. head as you edit.  *Note Real-time: Basic.
  322.    We call Emacs advanced because it provides facilities that go beyond
  323. simple insertion and deletion: controlling subprocesses; automatic
  324. indentation of programs; viewing two or more files at once; editing
  325. formatted text; and dealing in terms of characters, words, lines,
  326. sentences, paragraphs, and pages, as well as expressions and comments in
  327. several different programming languages.
  328.    "Self-documenting" means that at any time you can type a special
  329. character, `Control-h', to find out what your options are.  You can
  330. also use it to find out what any command does, or to find all the
  331. commands that pertain to a topic.  *Note Help::.
  332.    "Customizable" means that you can change the definitions of Emacs
  333. commands in little ways.  For example, if you use a programming
  334. language in which comments start with `<**' and end with `**>', you can
  335. tell the Emacs comment manipulation commands to use those strings
  336. (*note Comments::.).  Another sort of customization is rearrangement of
  337. the command set.  For example, if you prefer the four basic cursor
  338. motion commands (up, down, left and right) on keys in a diamond pattern
  339. on the keyboard, you can rebind the keys that way.  *Note
  340. Customization::.
  341.    "Extensible" means that you can go beyond simple customization and
  342. write entirely new commands, programs in the Lisp language to be run by
  343. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible" system,
  344. which means that it is divided into many functions that call each
  345. other, any of which can be redefined in the middle of an editing
  346. session.  Almost any part of Emacs can be replaced without making a
  347. separate copy of all of Emacs.  Most of the editing commands of Emacs
  348. are written in Lisp already; the few exceptions could have been written
  349. in Lisp but are written in C for efficiency.  Although only a programmer
  350. can write an extension, anybody can use it afterward.
  351.    When run under the X Window System, Emacs provides its own menus and
  352. convenient bindings to mouse buttons.  But Emacs can provide many of the
  353. benefits of a window system on a text-only terminal.  For instance, you
  354. can look at or edit several files at once, move text between them, and
  355. edit files at the same time as you run shell commands.
  356. File: emacs,  Node: Screen,  Next: User Input,  Prev: Acknowledgments,  Up: Top
  357. The Organization of the Screen
  358. ******************************
  359.    On a text-only terminal, the Emacs display occupies the whole screen.
  360. On the X Window System, Emacs creates its own X windows to use.  We use
  361. the term "frame" to mean an entire text-only screen or an entire X
  362. window used by Emacs.  Emacs uses both kinds of frames in the same way
  363. to display your editing.  Emacs normally starts out with just one frame,
  364. but you can create additional frames if you wish.  *Note Frames::.
  365.    When you start Emacs, the entire frame except for the last line is
  366. devoted to the text you are editing.  This area is called "window".
  367. The last line is a special "echo area" or "minibuffer window" where
  368. prompts appear and where you can enter responses.  You can subdivide
  369. the large text window horizontally or vertically into multiple text
  370. windows, each of which can be used for a different file (*note
  371. Windows::.).  In this manual, the word "window" always refers to the
  372. subdivisions of a frame within Emacs.
  373.    The window that the cursor is in is the "selected window", in which
  374. editing takes place.  Most Emacs commands implicitly apply to the text
  375. in the selected window (though mouse commands generally operate on
  376. whatever window you click them in, whether selected or not).  The other
  377. windows display text for reference only, unless/until you select them.
  378. If you use multiple frames under the X Window System, then giving the
  379. input focus to a particular frame selects a window in that frame.
  380.    Each window's last line is a "mode line" which describes what is
  381. going on in that window.  It appears in inverse video if the terminal
  382. supports that, and contains text that starts like `-----Emacs:
  383. SOMETHING'.  Its purpose is to indicate what buffer is being displayed
  384. above it in the window; what major and minor modes are in use; and
  385. whether the buffer contains unsaved changes.
  386. * Menu:
  387. * Point::    The place in the text where editing commands operate.
  388. * Echo Area::   Short messages appear at the bottom of the screen.
  389. * Mode Line::    Interpreting the mode line.
  390. File: emacs,  Node: Point,  Next: Echo Area,  Up: Screen
  391. Point
  392. =====
  393.    Within Emacs, the terminal's cursor shows the location at which
  394. editing commands will take effect.  This location is called "point".
  395. Many Emacs commands move point through the text, so that you can edit at
  396. different places in it.  You can also place point by clicking mouse
  397. button 1.
  398.    While the cursor appears to point AT a character, you should think
  399. of point as BETWEEN two characters; it points BEFORE the character that
  400. appears under the cursor.  For example, if your text looks like `frob'
  401. with the cursor over the `b', then point is between the `o' and the
  402. `b'.  If you insert the character `!' at that position, the result is
  403. `fro!b', with point between the `!' and the `b'.  Thus, the cursor
  404. remains over the `b', as before.
  405.    Sometimes people speak of "the cursor" when they mean "point", or
  406. speak of commands that move point as "cursor motion" commands.
  407.    Terminals have only one cursor, and when output is in progress it
  408. must appear where the typing is being done.  This does not mean that
  409. point is moving.  It is only that Emacs has no way to show you the
  410. location of point except when the terminal is idle.
  411.    If you are editing several files in Emacs, each in its own buffer,
  412. each buffer has its own point location.  A buffer that is not currently
  413. displayed remembers where point is in case you display it again later.
  414.    When there are multiple windows in a frame, each window has its own
  415. point location.  The cursor shows the location of point in the selected
  416. window.  This also is how you can tell which window is selected.  If the
  417. same buffer appears in more than one window, each window has its own
  418. position for point in that buffer.
  419.    When there are multiple frames, each frame can display one cursor.
  420. The cursor in the selected frame is solid; the cursor in other frames is
  421. a hollow box, and appears in the window that would be selected if you
  422. give the input focus to that frame.
  423.    The term `point' comes from the character `.', which was the command
  424. in TECO (the language in which the original Emacs was written) for
  425. accessing the value now called `point'.
  426. File: emacs,  Node: Echo Area,  Next: Mode Line,  Prev: Point,  Up: Screen
  427. The Echo Area
  428. =============
  429.    The line at the bottom of the frame (below the mode line) is the
  430. "echo area".  It is used to display small amounts of text for several
  431. purposes.
  432.    "Echoing" means displaying the characters that you type.  Outside
  433. Emacs, the operating system normally echoes all your input.  Emacs
  434. handles echoing differently.
  435.    Single-character commands do not echo in Emacs, and multi-character
  436. commands echo only if you pause while typing them.  As soon as you pause
  437. for more than a second in the middle of a command, Emacs echoes all the
  438. characters of the command so far.  This is to "prompt" you for the rest
  439. of the command.  Once echoing has started, the rest of the command
  440. echoes immediately as you type it.  This behavior is designed to give
  441. confident users fast response, while giving hesitant users maximum
  442. feedback.  You can change this behavior by setting a variable (*note
  443. Display Vars::.).
  444.    If a command cannot be executed, it may print an "error message" in
  445. the echo area.  Error messages are accompanied by a beep or by flashing
  446. the screen.  Also, any input you have typed ahead is thrown away when
  447. an error happens.
  448.    Some commands print informative messages in the echo area.  These
  449. messages look much like error messages, but they are not announced with
  450. a beep and do not throw away input.  Sometimes the message tells you
  451. what the command has done, when this is not obvious from looking at the
  452. text being edited.  Sometimes the sole purpose of a command is to print
  453. a message giving you specific information--for example, `C-x =' prints
  454. a message describing the character position of point in the text and
  455. its current column in the window.  Commands that take a long time often
  456. display messages ending in `...' while they are working, and add `done'
  457. at the end when they are finished.
  458.    Echo area informative messages are saved in an editor buffer named
  459. `*Messages*'.  (We have not explained buffers yet; see *Note Buffers::,
  460. for more information about them.)  If you miss a message that appears
  461. briefly on the screen, you can switch to the `*Messages*' buffer to see
  462. it again.  Successive progress messages are often collapsed into one.
  463.    The size of `*Messages*' is limited to a certain number of lines.
  464. The variable `message-log-max' specifies how many lines.  Once the
  465. buffer has that many lines, each line added at the end deletes one line
  466. from the beginning.  *Note Variables::, for how to set variables such as
  467. `message-log-max'.
  468.    The echo area is also used to display the "minibuffer", a window that
  469. is used for reading arguments to commands, such as the name of a file
  470. to be edited.  When the minibuffer is in use, the echo area begins with
  471. a prompt string that usually ends with a colon; also, the cursor
  472. appears in that line because it is the selected window.  You can always
  473. get out of the minibuffer by typing `C-g'.  *Note Minibuffer::.
  474. File: emacs,  Node: Mode Line,  Prev: Echo Area,  Up: Screen
  475. The Mode Line
  476. =============
  477.    Each text window's last line is a "mode line" which describes what
  478. is going on in that window.  When there is only one text window, the
  479. mode line appears right above the echo area.  The mode line is in
  480. inverse video if the terminal supports that, it starts and ends with
  481. dashes, and it contains text like `Emacs: SOMETHING'.
  482.    A few special editing modes, such as Dired and Rmail, display
  483. something else in place of `Emacs: SOMETHING'.  The rest of the mode
  484. line still has the usual meaning.
  485.    Normally, the mode line looks like this:
  486.      --CH-Emacs: BUF      (MAJOR MINOR)--LINE--POS------
  487. This gives information about the buffer being displayed in the window:
  488. the buffer's name, what major and minor modes are in use, whether the
  489. buffer's text has been changed, and how far down the buffer you are
  490. currently looking.
  491.    CH contains two stars `**' if the text in the buffer has been edited
  492. (the buffer is "modified"), or `--' if the buffer has not been edited.
  493. For a read-only buffer, it is `%*' if the buffer is modified, and `%%'
  494. otherwise.
  495.    BUF is the name of the window's "buffer".  In most cases this is the
  496. same as the name of a file you are editing.  *Note Buffers::.
  497.    The buffer displayed in the selected window (the window that the
  498. cursor is in) is also Emacs's selected buffer, the one that editing
  499. takes place in.  When we speak of what some command does to "the
  500. buffer", we are talking about the currently selected buffer.
  501.    LINE is `L' followed by the current line number of point.  This is
  502. present when Line Number mode is enabled (which it normally is).  You
  503. can optionally display the current column number too, by turning on
  504. Column Number mode (which is not enabled by default because it is
  505. somewhat slower).  *Note Optional Mode Line::.
  506.    POS tells you whether there is additional text above the top of the
  507. window, or below the bottom.  If your buffer is small and it is all
  508. visible in the window, POS is `All'.  Otherwise, it is `Top' if you are
  509. looking at the beginning of the buffer, `Bot' if you are looking at the
  510. end of the buffer, or `NN%', where NN is the percentage of the buffer
  511. above the top of the window.
  512.    MAJOR is the name of the "major mode" in effect in the buffer.  At
  513. any time, each buffer is in one and only one of the possible major
  514. modes.  The major modes available include Fundamental mode (the least
  515. specialized), Text mode, Lisp mode, C mode, Texinfo mode, and many
  516. others.  *Note Major Modes::, for details of how the modes differ and
  517. how to select one.
  518.    Some major modes display additional information after the major mode
  519. name.  For example, Rmail buffers display the current message number and
  520. the total number of messages.  Compilation buffers and Shell buffers
  521. display the status of the subprocess.
  522.    MINOR is a list of some of the "minor modes" that are turned on at
  523. the moment in the window's chosen buffer.  For example, `Fill' means
  524. that Auto Fill mode is on.  `Abbrev' means that Word Abbrev mode is on.
  525. `Ovwrt' means that Overwrite mode is on.  *Note Minor Modes::, for
  526. more information.  `Narrow' means that the buffer being displayed has
  527. editing restricted to only a portion of its text.  This is not really a
  528. minor mode, but is like one.  *Note Narrowing::.  `Def' means that a
  529. keyboard macro is being defined.  *Note Keyboard Macros::.
  530.    In addition, if Emacs is currently inside a recursive editing level,
  531. square brackets (`[...]') appear around the parentheses that surround
  532. the modes.  If Emacs is in one recursive editing level within another,
  533. double square brackets appear, and so on.  Since recursive editing
  534. levels affect Emacs globally, not just one buffer, the square brackets
  535. appear in every window's mode line or not in any of them.  *Note
  536. Recursive Edit::.
  537.    *Note Optional Mode Line::, for features that add other handy
  538. information to the mode line, such as the current line number of point,
  539. the current time, and whether new mail for you has arrived.
  540. File: emacs,  Node: User Input,  Next: Keys,  Prev: Screen,  Up: Top
  541. Kinds of User Input
  542. ===================
  543.    GNU Emacs uses an extension of the ASCII character set for keyboard
  544. input; it also accepts non-character input events including function
  545. keys and mouse button actions.
  546.    ASCII consists of 128 character codes.  Some of these codes are
  547. assigned graphic symbols such as `a' and `='; the rest are control
  548. characters, such as `Control-a' (usually written `C-a' for short).
  549. `C-a' gets its name from the fact that you type it by holding down the
  550. CTRL key while pressing `a'.
  551.    Some control characters have special names, and special keys you can
  552. type them with: for example, RET, TAB, LFD, DEL and ESC.  The space
  553. character is usually referred to below as SPC, even though strictly
  554. speaking it is a graphic character whose graphic happens to be blank.
  555.    On ASCII terminals, there are only 32 possible control characters.
  556. These are the control variants of letters and `@[]\^_'.  In addition,
  557. the shift key is meaningless with control characters: `C-a' and `C-A'
  558. are the same character, and Emacs cannot distinguish them.
  559.    But the Emacs character set has room for control variants of all
  560. characters, and for distinguishing between `C-a' and `C-A'.  X Windows
  561. makes it possible to enter all these characters.  For example, `C--'
  562. (that's Control-Minus) and `C-5' are meaningful Emacs commands under X.
  563.    Another Emacs character set extension is that characters have
  564. additional modifier bits.  Only one modifier bit is commonly used; it is
  565. called Meta.  Every character has a Meta variant; examples include
  566. `Meta-a' (normally written `M-a', for short), `M-A' (not the same
  567. character as `M-a', but those two characters normally have the same
  568. meaning in Emacs), `M-RET', and `M-C-a'.  For reasons of tradition, we
  569. usually write `C-M-a' rather than `M-C-a'; logically speaking, the
  570. order in which the modifier keys CTRL and META are mentioned does not
  571. matter.
  572.    Some terminals have a META key, and allow you to type Meta
  573. characters by holding this key down.  Thus, `Meta-a' is typed by
  574. holding down META and pressing `a'.  The META key works much like the
  575. SHIFT key.  Such a key is not always labeled META, however, as this
  576. function is often a special option for a key with some other primary
  577. purpose.
  578.    If there is no META key, you can still type Meta characters using
  579. two-character sequences starting with ESC.  Thus, to enter `M-a', you
  580. could type `ESC a'.  To enter `C-M-a', you would type `ESC C-a'.  ESC
  581. is allowed on terminals with META keys, too, in case you have formed a
  582. habit of using it.
  583.    X Windows provides several other modifier keys that can be applied to
  584. any input character.  These are called SUPER, HYPER and ALT.  We write
  585. `s-', `H-' and `A-' to say that a character uses these modifiers.
  586. Thus, `s-H-C-x' is short for `Super-Hyper-Control-x'.  Not all X
  587. terminals actually provide keys for these modifier flags--in fact, many
  588. terminals have a key labeled ALT which is really a META key.  The
  589. standard key bindings of Emacs do not include any characters with these
  590. modifiers.  But you can assign them meanings of your own by customizing
  591. Emacs.
  592.    Keyboard input includes keyboard keys that are not characters at all:
  593. for example function keys and arrow keys.  Mouse buttons are also
  594. outside the gamut of characters.  You can modify these events with the
  595. modifier keys CONTROL, META, SUPER, HYPER and ALT like keyboard
  596. characters.
  597.    Input characters and non-character inputs are collectively called
  598. "input events".  *Note Input Events: (elisp)Input Events, for more
  599. information.  If you are not doing Lisp programming, but simply want to
  600. redefine the meaning of some characters or non-character events, see
  601. *Note Customization::.
  602.    ASCII terminals cannot really send anything to the computer except
  603. ASCII characters.  These terminals use a sequence of characters to
  604. represent each function key.  But that is invisible to the Emacs user,
  605. because the keyboard input routines recognize these special sequences
  606. and convert them to function key events before any other part of Emacs
  607. gets to see them.
  608. File: emacs,  Node: Keys,  Next: Commands,  Prev: User Input,  Up: Top
  609.    A "key sequence" ("key", for short) is a sequence of input events
  610. that are meaningful as a unit--as "a single command." Some Emacs
  611. command sequences are just one character or one event; for example,
  612. just `C-f' is enough to move forward one character.  But Emacs also has
  613. commands that take two or more events to invoke.
  614.    If a sequence of events is enough to invoke a command, it is a
  615. "complete key".  Examples of complete keys include `C-a', `X', RET,
  616. NEXT (a function key), DOWN (an arrow key), `C-x C-f' and `C-x 4 C-f'.
  617. If it isn't long enough to be complete, we call it a "prefix key".  The
  618. above examples show that `C-x' and `C-x 4' are prefix keys.  Every key
  619. sequence is either a complete key or a prefix key.
  620.    Most single characters constitute complete keys in the standard Emacs
  621. command bindings.  A few of them are prefix keys.  A prefix key combines
  622. with the following input event to make a longer key sequence, which may
  623. itself be complete or a prefix.  For example, `C-x' is a prefix key, so
  624. `C-x' and the next input event combine to make a two-character key
  625. sequence.  Most of these key sequences are complete keys, including
  626. `C-x C-f' and `C-x b'.  A few, such as `C-x 4' and `C-x r', are
  627. themselves prefix keys that lead to three-character key sequences.
  628. There's no limit to the length of a key sequence, but in practice
  629. people rarely use sequences longer than four events.
  630.    By contrast, you can't add more events onto a complete key.  For
  631. example, the two-character sequence `C-f C-k' is not a key, because the
  632. `C-f' is a complete key in itself.  It's impossible to give `C-f C-k'
  633. an independent meaning as a command.  `C-f C-k' is two key sequences,
  634. not one.
  635.    All told, the prefix keys in Emacs are `C-c', `C-h', `C-x', `C-x
  636. C-a', `C-x n', `C-x r', `C-x v', `C-x 4', `C-x 5', `C-x 6', and ESC.
  637. But this is not cast in concrete; it is just a matter of Emacs's
  638. standard key bindings.  If you customize Emacs, you can make new prefix
  639. keys, or eliminate these.  *Note Key Bindings::.
  640.    If you do make or eliminate prefix keys, that changes the set of
  641. possible key sequences.  For example, if you redefine `C-f' as a
  642. prefix, `C-f C-k' automatically becomes a key (complete, unless you
  643. define it too as a prefix).  Conversely, if you remove the prefix
  644. definition of `C-x 4', then `C-x 4 f' (or `C-x 4 ANYTHING') is no
  645. longer a key.
  646.    Typing the help character (`C-h' or F1) after a prefix character
  647. displays a list of the commands starting with that prefix.  There are a
  648. few prefix characters for which `C-h' does not work--for historical
  649. reasons, they have other meanings for `C-h' which are not easy to
  650. change.  But F1 should work for all prefix characters.
  651. File: emacs,  Node: Commands,  Next: Text Characters,  Prev: Keys,  Up: Top
  652. Keys and Commands
  653. =================
  654.    This manual is full of passages that tell you what particular keys
  655. do.  But Emacs does not assign meanings to keys directly.  Instead,
  656. Emacs assigns meanings to named "commands", and then gives keys their
  657. meanings by "binding" them to commands.
  658.    Every command has a name chosen by a programmer.  The name is usually
  659. made of a few English words separated by dashes; for example,
  660. `next-line' or `forward-word'.  A command also has a "function
  661. definition" which is a Lisp program; this is what makes the command do
  662. what it does.  In Emacs Lisp, a command is actually a special kind of
  663. Lisp function; one which specifies how to read arguments for it and
  664. call it interactively.  For more information on commands and functions,
  665. see *Note What Is a Function: (elisp)What Is a Function.  (The
  666. definition we use in this manual is simplified slightly.)
  667.    The bindings between keys and commands are recorded in various tables
  668. called "keymaps".  *Note Keymaps::.
  669.    When we say that "`C-n' moves down vertically one line" we are
  670. glossing over a distinction that is irrelevant in ordinary use but is
  671. vital in understanding how to customize Emacs.  It is the command
  672. `next-line' that is programmed to move down vertically.  `C-n' has this
  673. effect *because* it is bound to that command.  If you rebind `C-n' to
  674. the command `forward-word' then `C-n' will move forward by words
  675. instead.  Rebinding keys is a common method of customization.
  676.    In the rest of this manual, we usually ignore this subtlety to keep
  677. things simple.  To give the information needed for customization, we
  678. state the name of the command which really does the work in parentheses
  679. after mentioning the key that runs it.  For example, we will say that
  680. "The command `C-n' (`next-line') moves point vertically down," meaning
  681. that `next-line' is a command that moves vertically down and `C-n' is a
  682. key that is standardly bound to it.
  683.    While we are on the subject of information for customization only,
  684. it's a good time to tell you about "variables".  Often the description
  685. of a command will say, "To change this, set the variable `mumble-foo'."
  686. A variable is a name used to remember a value.  Most of the variables
  687. documented in this manual exist just to facilitate customization: some
  688. command or other part of Emacs examines the variable and behaves
  689. differently according to the value that you set.  Until you are
  690. interested in customizing, you can ignore the information about
  691. variables.  When you are ready to be interested, read the basic
  692. information on variables, and then the information on individual
  693. variables will make sense.  *Note Variables::.
  694. File: emacs,  Node: Text Characters,  Next: Entering Emacs,  Prev: Commands,  Up: Top
  695. Character Set for Text
  696. ======================
  697.    Emacs buffers use an 8-bit character set, because bytes have 8 bits.
  698. ASCII graphic characters in Emacs buffers are displayed with their
  699. graphics.  The newline character (which has the same character code as
  700. LFD) is displayed by starting a new line.  The tab character is
  701. displayed by moving to the next tab stop column (normally every 8
  702. columns).  Other control characters are displayed as a caret (`^')
  703. followed by the non-control version of the character; thus, `C-a' is
  704. displayed as `^A'.  Non-ASCII characters 128 and up are displayed with
  705. octal escape sequences; thus, character code 243 (octal) is displayed
  706. as `\243'.
  707.    You can customize the display of these character codes (or ASCII
  708. characters) by creating a "display table".  *Note Display Tables:
  709. (elisp)Display Tables.  This is useful for editing files that use 8-bit
  710. European character sets.  *Note European Display::.
  711. File: emacs,  Node: Entering Emacs,  Next: Exiting,  Prev: Text Characters,  Up: Top
  712. Entering and Exiting Emacs
  713. **************************
  714.    The usual way to invoke Emacs is with the shell command `emacs'.
  715. Emacs clears the screen and then displays an initial help message and
  716. copyright notice.  Some operating systems discard all type-ahead when
  717. Emacs starts up; they give Emacs no way to prevent this.  Therefore, it
  718. is advisable to wait until Emacs clears the screen before typing your
  719. first editing command.
  720.    If you run Emacs from a shell window under the X Window System, run
  721. it in the background with `emacs&'.  This way, Emacs does not tie up
  722. the shell window, so you can use that to run other shell commands while
  723. Emacs operates its own X windows.  You can begin typing Emacs commands
  724. as soon as you direct your keyboard input to the Emacs frame.
  725.    When Emacs starts up, it makes a buffer named `*scratch*'.  That's
  726. the buffer you start out in.  The `*scratch*' buffer uses Lisp
  727. Interaction mode; you can use it to type Lisp expressions and evaluate
  728. them, or you can ignore that capability and simply doodle.  (You can
  729. specify a different major mode for this buffer by setting the variable
  730. `initial-major-mode' in your init file.  *Note Init File::.)
  731.    It is possible to specify files to be visited, Lisp files to be
  732. loaded, and functions to be called, by giving Emacs arguments in the
  733. shell command line.  *Note Command Arguments::.  But we don't recommend
  734. doing this.  The feature exists mainly for compatibility with other
  735. editors.
  736.    Many other editors are designed to be started afresh each time you
  737. want to edit.  You edit one file and then exit the editor.  The next
  738. time you want to edit either another file or the same one, you must run
  739. the editor again.  With these editors, it makes sense to use a command
  740. line argument to say which file to edit.
  741.    But starting a new Emacs each time you want to edit a different file
  742. does not make sense.  For one thing, this would be annoyingly slow.  For
  743. another, this would fail to take advantage of Emacs's ability to visit
  744. more than one file in a single editing session.  And it would lose the
  745. other accumulated context, such as registers, undo history, and the mark
  746. ring.
  747.    The recommended way to use GNU Emacs is to start it only once, just
  748. after you log in, and do all your editing in the same Emacs session.
  749. Each time you want to edit a different file, you visit it with the
  750. existing Emacs, which eventually comes to have many files in it ready
  751. for editing.  Usually you do not kill the Emacs until you are about to
  752. log out.  *Note Files::, for more information on visiting more than one
  753. file.
  754.